<div class="layui-container" style="background-color: #fff;">
    <div class="layui-row">
        <div style="padding: 20px;">
            <span style="color:red"><b>{$data['info']}</b>：</span>
            <a href="/api/v1/{$data['hash']}" target="_blank">/api/v1/{$data['hash']}</a>
            <span class="text-left label label-success">{$data['method_turn']}</span>
            <span class="text-left label {if $data['status'] == 0 }label-danger{else /}{eq name=" $data['isTest']"
            value='0' }label-success{else /}label-warning{/eq}{/if}">
            {eq name="$data['status']" value="0"}{$data['status_turn']}{else /}{$data['isTest_turn']}{/eq}
            </span>

        </div>
        <div style="padding:0 20px 20px 20px;">
            <span><b>真实地址</b>：</span>
            <span class="text-left label">
                {$data['apiname']}
            </span>
        </div>
    </div>

    <div class="layui-tab">
        <ul class="nav nav-tabs layui-tab-title">
            <li class="layui-this"><a aria-expanded="true">请求参数</a></li>
            <li class=""><a aria-expanded="false">返回参数</a></li>
            <li class=""><a aria-expanded="false">返回示例</a></li>
            <li class=""><a aria-expanded="false">自测</a></li>
        </ul>


        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show" id="tab_1">
                <fieldset class="layui-elem-field layui-field-title">
                    <legend>公共请求参数</legend>
                </fieldset>
                <div class="box no-header">
                    <div class="box-body table-responsive no-padding">
                        <table class="layui-table">
                            <tbody>
                            <tr>
                                <th width="100">参数名字</th>
                                <th width="120">类型</th>
                                <th width="80">是否必须</th>
                                <th width="70">默认值</th>
                                <th>其他</th>
                                <th>说明</th>
                            </tr>

                            <tr>
                                <td>timestamp</td>
                                <td><span class="label label-success">String[字符串]</span></td>
                                <td class="text-center">
                                    <span class="label label-success">选填</span>
                                </td>
                                <td></td>
                                <td></td>
                                <td>请求时间戳 （北京时间）</td>
                            </tr>
                            <tr>
                                <td>usertoken</td>
                                <td><span class="label label-success">String[字符串]</span></td>
                                <td class="text-center">
                                        <span
                                                class="label {if $data['needlogin'] == 0 }label-success{else /}label-danger{/if}">
                                            {if $data['needlogin'] == 0 }选填{else /}必填{/if}
                                        </span>
                                </td>
                                <td></td>
                                <td></td>
                                <td>usertoken用户认证秘钥【请通过登录获取】</td>
                            </tr>

                            </tbody>
                        </table>
                    </div>
                </div>

                <fieldset class="layui-elem-field layui-field-title">
                    <legend>请求参数</legend>
                </fieldset>
                <div class="layui-row">
                    <div class="layui-row">
                        <table class="layui-table">
                            <tbody>
                            <tr>
                                <th width="100">参数名字</th>
                                <th width="120">类型</th>
                                <th width="80">是否必须</th>
                                <th width="70">默认值</th>
                                <th>其他</th>
                                <th>说明</th>
                            </tr>
                            {volist name="$q_field" id="vo"}
                            <tr>
                                <td>{$vo['fieldname']}</td>
                                <td><span class="label label-success">{$vo['datatype_turn']}</span></td>
                                <td class="text-center">
                                        <span
                                                class="label {if $vo['ismust'] == 0 }label-success{else /}label-danger{/if}">
                                            {$vo['ismust_turn']}
                                        </span>
                                </td>
                                <td>{$vo['default']}</td>
                                <td></td>
                                <td>{$vo['info']}</td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

            <div class="layui-tab-item" id="tab_2">

                <fieldset class="layui-elem-field layui-field-title">
                    <legend>公共返回参数</legend>
                </fieldset>
                <div class="layui-row">
                    <div class="layui-row">
                        <table class="layui-table">
                            <tbody>
                            <tr>
                                <th width="100">返回字段</th>
                                <th width="">类型</th>
                                <th>说明</th>
                            </tr>
                            <tr>
                                <td>code</td>
                                <td><span class="label label-success">Integer[整数]</span></td>
                                <td>返回码，详情请参阅<a href="javascript:void(0);" data-url="{:url('errorlist')}"
                                                        data-toggle="dialog">状态码说明</a></td>
                            </tr>
                            <tr>
                                <td>msg</td>
                                <td><span class="label label-success">String[字符串]</span></td>
                                <td>返回中文状态描述，详情请参阅<a href="javascript:void(0);"
                                                                  data-url="{:url('errorlist')}"
                                                                  data-toggle="dialog">状态码说明</a></td>
                            </tr>
                            <tr>
                                <td>data</td>
                                <td><span class="label label-success">json</span></td>
                                <td>返回json类型数据</td>
                            </tr>

                            <tr>
                                <td>user</td>
                                <td><span class="label label-success">json</span></td>
                                <td>
                                    返回json类型数据,若你使用了UserToken鉴权，此处透传变动前的会员基础信息
                                    详情请参阅<a href="javascript:void(0);" data-url="{:url('userlist')}"
                                                 data-toggle="dialog">会员信息字段说明</a>
                                </td>
                            </tr>
                            <tr>
                                <td>page</td>
                                <td><span class="label label-success">json</span></td>
                                <td>
                                    返回json类型数据,若此接口包含分页请求，此处传递分页参数：
                                    {total:总数,lastPage:最后一页页码,currentPage:当前页码,listRows:每页数量}<br/>
                                    客户端可传递list_rows修改每页数量
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>

                <fieldset class="layui-elem-field layui-field-title">
                    <legend>data参数</legend>
                </fieldset>
                <div class="layui-row">
                    <div class="layui-row">
                        <table class="layui-table">
                            <tbody>
                            <tr>
                                <th width="100">返回字段</th>
                                <th>类型</th>
                                <th>说明</th>
                            </tr>
                            {volist name="$f_field" id="vo"}
                            <tr>
                                <td>{$vo['fieldname']}</td>
                                <td><span class="label label-success">{$vo['datatype_turn']}</span></td>
                                <td>{$vo['info']}</td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>


            <div class="layui-tab-item" id="tab_3">
                <pre>{$data.returnstr|raw}</pre>
            </div>

            <div class="layui-tab-item" id="tab_4">
                <form id="form4" method="post" onsubmit="return false;">
                    <fieldset class="layui-elem-field layui-field-title">
                        <legend>公共请求参数</legend>
                    </fieldset>
                    <div class="layui-row">
                        <div class="layui-row">
                            <table class="layui-table">
                                <tbody>
                                <tr>
                                    <th width="100">参数</th>
                                    <th width="200">值</th>
                                    <th width="80">是否必须</th>
                                    <th>说明</th>
                                </tr>
                                <tr>
                                    <td>版本号</td>
                                    <td><input id="version" value="v1" class="layui-input"/></td>
                                    <td><span class="label label-danger">必填</span></td>
                                    <td>请填写接口版本号</td>
                                </tr>
                                <tr>
                                    <td>用户ID</td>
                                    <td><input name="user_id" value="" class="layui-input"/></td>
                                    <td>
                                            <span
                                                    class="label {if $data['needlogin'] == 0 }label-success{else /}label-danger{/if}">
                                                {if $data['needlogin'] == 0 }选填{else /}必填{/if}
                                            </span>
                                    </td>
                                    <td>请填写用户ID，用于模拟获取UserToken用户认证秘钥</td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>

                    <fieldset class="layui-elem-field layui-field-title">
                        <legend>请求参数</legend>
                    </fieldset>
                    <div class="layui-row">
                        <div class="layui-row">
                            <table class="layui-table">
                                <tbody>
                                <tr>
                                    <th width="100">参数名字</th>
                                    <th width="200">值</th>
                                    <th width="80">是否必须</th>

                                    <th>说明</th>
                                </tr>
                                {volist name="$q_field" id="vo"}
                                <tr>
                                    <td>{$vo['fieldname']}</td>
                                    <td>
                                        {eq name="$vo.datatype" value="6"}

                                        <input data-name="{$vo['fieldname']}" class="layui-input" type="file"
                                               class="layui-input"/>
                                        {else /}

                                        <input name="{$vo['fieldname']}" value="{$vo['default']}"
                                               class="layui-input"/>

                                        {/eq}
                                    </td>
                                    <td class="text-center">
                                            <span
                                                    class="label {if $vo['ismust'] == 0 }label-success{else /}label-danger{/if}">
                                                {$vo['ismust_turn']}
                                            </span>
                                    </td>

                                    <td>{$vo['info']}</td>
                                </tr>
                                {/volist}
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="layui-btn-container">
                        <button class="layui-btn" style="display: block;margin: 0 auto;" id="submit"
                                data-method="{$data['method_turn']}"
                                data-url="{:url('apitest',['hash'=>$data['hash'],'version'=>'versionid' ])}">模拟请求
                        </button>
                    </div>
                </form>

                <div id="result">


                </div>
            </div>
        </div>
    </div>
</div>